package com.jy.rhin.model.body.tangniaobsf;


import com.jy.rhin.infra.cda.EDataElement;
import com.jy.rhin.infra.cda.XPath;
import com.jy.rhin.infra.cda.XValid;
import com.jy.rhin.model.CodeObject;
import com.jy.rhin.model.ValueUnit;
import com.jy.rhin.model.body.gaoxueysf.YongYaoItem;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class YongYao {

    //中药使用类别
    @XPath(path = "/entry/observation/code[@code='DE06.00.164.00']/../value"
            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE06_00_164_00, nullable = true))
    CodeObject zhongYaoSYLB;

    //用药条目列表
    @XPath(path = "."
            , listItemPath = "/entry/substanceAdministration/consumable/manufacturedProduct/manufacturedLabeledDrug/code[@code!='DE08.50.013.00']/../../../.."
            , listItemBackLevel = 0)
    List<YongYaoItem> yongYaoItemList = new ArrayList<>();

    //胰岛素单次用药剂量
    @XPath(path = "/entry/substanceAdministration/consumable/manufacturedProduct/manufacturedLabeledDrug/code[@code='DE08.50.013.00']/../../../../doseQuantity"
            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE08_50_023_01))
    ValueUnit yiDaoSDCJL;
    //胰岛素药物使用频率
    @XPath(path = "/entry/substanceAdministration/consumable/manufacturedProduct/manufacturedLabeledDrug/code[@code='DE08.50.013.00']/../../../../rateQuantity"
            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE06_00_133_00))
    ValueUnit yiDaoSSYPL;
    //胰岛素药品名称
    @XPath(path = "/entry/substanceAdministration/consumable/manufacturedProduct/manufacturedLabeledDrug/code[@code='DE08.50.013.00']/../name/text()"
            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE08_50_013_00))
    String yiDaoSMC;

    //低血糖反应代码
    @XPath(path = "/entry/observation/code[@code='DE04.50.024.00']/../value"
            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE04_50_024_00))
    CodeObject diXueTFY;

}